<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>绑定邮箱</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            max-width: 500px;
            margin: 0 auto;
            padding: 20px;
            background-color: #f5f5f5;
        }
        .container {
            background-color: white;
            padding: 20px;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }
        h1 {
            text-align: center;
            color: #333;
        }
        .form-group {
            margin-bottom: 15px;
        }
        label {
            display: block;
            margin-bottom: 5px;
            font-weight: bold;
        }
        input[type="email"] {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            box-sizing: border-box;
        }
        button {
            width: 100%;
            padding: 10px;
            background-color: #4CAF50;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
        }
        button:hover {
            background-color: #45a049;
        }
        .message {
            padding: 10px;
            margin-bottom: 15px;
            border-radius: 4px;
        }
        .success {
            background-color: #d4edda;
            color: #155724;
        }
        .error {
            background-color: #f8d7da;
            color: #721c24;
        }
        .back-link {
            display: block;
            text-align: center;
            margin-top: 15px;
            color: #2196F3;
            text-decoration: none;
        }
        .back-link:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>绑定邮箱</h1>
        {% with messages = get_flashed_messages() %}
            {% if messages %}
                {% if '成功' in messages[0] %}
                    <div class="message success">{{ messages[0] }}</div>
                {% else %}
                    <div class="message error">{{ messages[0] }}</div>
                {% endif %}
            {% endif %}
        {% endwith %}
        <form method="POST" action="{{ url_for('bind_email') }}">
            <div class="form-group">
                <label for="email">邮箱地址:</label>
                <input type="email" id="email" name="email" required placeholder="请输入您的邮箱地址">
            </div>
            <button type="submit">绑定邮箱</button>
        </form>
        <a href="{{ url_for('dashboard') }}" class="back-link">返回个人网盘</a>
    </div>
</body>
</html>